import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: () => import(/* webpackChunkName: "userLogin" */ '@/views/user/login/UserLogin')
  },
  {
    path: '/reginster',
    name: 'reginster',
    component: () => import(/* webpackChunkName: "userLogin" */ '@/views/user/reginster/UserReginster')
  },
  {
    path: '/footer',
    name: 'footer',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "footer" */ '@/components/PublicFooter')
  },
  {
    path: '/chatInfo',
    name: 'chatInfo',
    component: () => import(/* webpackChunkName: "chatInfo" */ '@/views/chat/info/ChatInfo'),
    props: true
  },
  {
    path: '/home',
    name: 'home',
    component: () => import(/* webpackChunkName: "chatHome" */ '@/views/robot/RobotInfo')
  },
  {
    path: '/robotSetting',
    name: 'robotSetting',
    component: () => import(/* webpackChunkName: "robotSetting" */ '@/views/robot/RobotSetting')
  },
  {
    path: '/addRobot',
    name: 'addRobot',
    component: () => import(/* webpackChunkName: "addRobot" */ '@/views/robot/AddRobot')
  },
  {
    path: '/imageInfo',
    name: 'imageInfo',
    component: () => import(/* webpackChunkName: "imageInfo" */ '@/views/chat/info/ImageInfo'),
    props: true
  },
  {
    path: '/robotGroup',
    name: 'robotGroup',
    component: () => import(/* webpackChunkName: "robotGroup" */ '@/views/robot/RobotGroup')
  },
  {
    path: '/userInfo',
    name: 'userInfo',
    component: () => import(/* webpackChunkName: "userInfo" */ '@/views/user/UserInfo')
  },
  {
    path: '/userSetting',
    name: 'userSetting',
    component: () => import(/* webpackChunkName: "userSetting" */ '@/views/user/info/UserSetting')
  },
  {
    path: '/test',
    name: 'test',
    component: () => import(/* webpackChunkName: "test" */ '@/views/chat/info/test')
  },
  {
    path: '*',
    name: 'error-page',
    component: () => import(/* webpackChunkName: "error-page" */ '@/views/error-page/ErrorPage')
  }
]

const router = new VueRouter({
  routes
})

export default router
